using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Media3D;
using System.Windows;
using System.Windows.Media;
using System.Windows.Controls;

namespace _3DHouse.CustomControl
{
    public class Sensor:Cube
    {
        public Sensor() { }
        /// <summary>
        /// 
        /// </summary>
        public static readonly DependencyProperty StateProperty = DependencyProperty.Register("State", typeof(bool), typeof(Sensor), new FrameworkPropertyMetadata(
      new PropertyChangedCallback(OnSensorChange)));
        public static Sensor GetSensor()
        {
            Sensor sensor = new Sensor();
            //读取资源
            GeometryModel3D group = (GeometryModel3D)Application.Current.Resources["Sensor"];
            //更改资源中变换为坐标变换
            group = TransformResources(group);
            sensor.Content = group;
            return sensor;
        }
        static void OnSensorChange(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
        }

        SensorState state;
        /// <summary>
        /// 传感器状态
        /// </summary>
        public SensorState State
        {
            get { return state; }
            set { state = value; }
        }
        AlarmType alarmType;
        /// <summary>
        /// 报警类别
        /// </summary>
        public AlarmType AlarmType
        {
            get { return alarmType; }
            set { alarmType = value; }
        }
        Color alarmColor = Colors.Green;
        /// <summary>
        /// 报警颜色
        /// </summary>
        public Color AlarmColor
        {
            get { return alarmColor; }
            set { alarmColor = value; }
        }
    }
}
